﻿package cz.dadul.adventure 
{
	/**
	 * ...
	 * @author Dadul
	 */
	import mx.core.*;
	
	import cz.dadul.adventure.controllers.*;
	import cz.dadul.adventure.assets.*;
	import cz.dadul.adventure.core.*;
	
	import gs.TweenMax;
	import gs.easing.*;
	 
	public class Tester extends UIComponent 
	{
		// ----------- Imported Flash classes --------------------
		[Embed(source='../../../../lib/resource.swf', symbol='animatedItem1')]
		private var itemImport1:Class;
		[Embed(source='../../../../lib/resource.swf', symbol='animatedItem2')]
		private var itemImport2:Class;
		[Embed(source='../../../../lib/resource.swf', symbol='player')]
		private var playerImport:Class;
		
		private var _prop:String;
		
		public function Tester() 
		{

  
		}
		
		public function init():void {
			//stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
			//stage.addEventListener(KeyboardEvent.KEY_DOWN, movePlayer);
			var playerController:PlayerController = PlayerController.getInstance();			
			var layerController:LayerController = LayerController.getInstance();
			
		
			var player:Player = new Player(new playerImport());
				
			// Create layers
			var layer:Layer = new Layer();
			
			layerController.addLayer(layer, "bckgLayer");
			layerController.addLayer(new MainLayer(), "mainLayer", true);
			
		
			layerController.addElement(new Item(new itemImport1()), "item1", "bckgLayer");			
			layerController.addMainElement(new Item(new itemImport2()), "item2");
			
			// Adds the main player
			playerController.layerController = layerController;
			playerController.initPlayer(player, 300, 300);
			playerController.initPath(/* path instance*/);
			
			// Adds only layer controller stage
			addChild(layerController);			
		}
				
		public function set prop(str:String):void {
			trace("Prop set to: " + str);
			this._prop = str;
		}
	
		public function get prop():String{
			return this._prop;
		}

	}
}